<nz-card class="content-box">

    <div class="d-flex align-items-center mb-sm" style="justify-content: flex-end;">
        <button nz-button nzType="primary" (click)="menuAction('新增组织')" acl
            [acl-ability]="['SYSTEM-ROLE-add']">新增</button>
    </div>

    <nz-table #expandTable [nzData]="listOfMapData" nzTableLayout="fixed" nzBordered nzSize="small"
        [nzLoading]="service.http.loading">
        <thead>
            <tr>
                <!-- <th nzWidth="70px" nzAlign="center">#</th> -->
                <th>组织名称</th>
                <th>组织描述</th>
                <th>创建人手机号</th>
                <th nzAlign="center">创建时间</th>
                <th nzAlign="center" nzWidth="250px">操作</th>
            </tr>
        </thead>
        <tbody>
            <ng-container *ngFor="let data of expandTable.data">
                <ng-container *ngFor="let item of mapOfExpandedData[data.key];let i = index">
                    <tr *ngIf="(item.parent && item.parent.expand) || !item.parent">
                        <!-- <td nzWidth="70px" nzAlign="center" [nzChecked]="item.checked">{{ i+1 }}</td> -->
                        <td [nzIndentSize]="item.level! * 20" [nzShowExpand]="!!item.children"
                            [(nzExpand)]="item.expand"
                            (nzExpandChange)="service.collapse(mapOfExpandedData[data.key], item, $event)">
                            {{ item.roleName }}
                        </td>
                        <td>{{ item.roleDescription }}</td>
                        <td>{{ item.link }}</td>
                        <td nzAlign="center">
                            {{ item.createTime }}
                        </td>
                        <td nzAlign="center" nzWidth="250px">
                            <ng-container *ngIf="item.roleCode !== 'Administrator'">
                                <a (click)="menuAction(item)" acl [acl-ability]="['SYSTEM-ROLE-edit']">编辑</a>
                                <nz-divider nzType="vertical"></nz-divider>
                                <a (click)="deleteAction(item)" acl [acl-ability]="['SYSTEM-ROLE-delete']">删除</a>
                                <nz-divider nzType="vertical"></nz-divider>
                                <a (click)="menuAction(null,item.id)" acl [acl-ability]="['SYSTEM-ROLE-add']">新增子组织</a>
                                <br>
                                <nz-divider nzType="vertical"></nz-divider>
                                <a (click)="configureAPIauth(item)" acl [acl-ability]="['SYSTEM-ROLE-api']">配置接口权限</a>
                                <nz-divider nzType="vertical"></nz-divider>
                                <a acl [acl-ability]="['SYSTEM-ROLE-data']">配置数据权限</a>
                            </ng-container>

                        </td>
                    </tr>
                </ng-container>
            </ng-container>
        </tbody>
    </nz-table>
</nz-card>